package com.yx.shop.service.admin.impl;

import com.yx.shop.dao.admin.AdminOrderDao;
import com.yx.shop.dao.admin.impl.AdminOrderDaoImpl;
import com.yx.shop.entitly.Orders;
import com.yx.shop.service.admin.AdminOrderService;
import com.yx.shop.utils.JDBCUtils;

import java.util.List;

/**
 * @Classname AdminOrderServiceImpl
 * @Description TODO:
 * @Date 2021/05/10 20:29
 * @Created by yx
 */
public class AdminOrderServiceImpl implements AdminOrderService {
    private AdminOrderDao adminOrderDao = new AdminOrderDaoImpl();

    @Override
    public List<Orders> getAllOrder() {
        List<Orders> ordersList = null;
        try {
            JDBCUtils.begin();
            ordersList = adminOrderDao.getAllOrder();
            JDBCUtils.commit();
        } catch (Exception e) {
            JDBCUtils.rollback();
            e.printStackTrace();
        }
        return ordersList;
    }
}
